package com.diligent.cloud.sfc.util;

import com.canny.commons.model.ObjectResult;

/**
 * ConverterUtil class
 *
 * @author xf107278
 * @date 3/30/2020
 */
public class ConverterUtil {

    public static ObjectResult ConverterByResult(com.diligent.cloud.primary.data.model.Result result) {
        ObjectResult answer = new ObjectResult(result.getData());
        answer.modifyCode(result.getCode(), result.getMsg());
        return answer;
    }

    public static ObjectResult ConverterByData(Object data, Integer code, String msg) {
        ObjectResult answer = new ObjectResult(data);
        answer.modifyCode(code, msg);
        return answer;
    }
}
